﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace X23.ApplicationJob.Application.Dto
{
    public class AllJobDto
    {
        /// <summary>
        /// 关键字
        /// </summary>
        public string Key { get; set; }
        /// <summary>
        /// 方法名称
        /// </summary>
        public string Methtod { get; set; }
        /// <summary>
        /// Cron表达式
        /// </summary>
        public string Cron { get; set; }
        /// <summary>
        /// 任务名称
        /// </summary>
        public string JobName { get; set; }
        /// <summary>
        /// Cron表达式名称
        /// </summary>
        public string CronName { get; set; }

        /// <summary>
        /// 任务状态 0未执行 1正在执行
        /// </summary>
        public JobStatus JobStatus { get; set; }

        public string Json { get; set; }
        ///// <summary>
        ///// 创建任务时间
        ///// </summary>
        //public DateTime? CreatedAt { get; set; }
        ///// <summary>
        ///// 下次任务执行时间
        ///// </summary>
        //public DateTime? NextExecution { get; set; }
        ///// <summary>
        ///// 上次任务执行时间
        ///// </summary>
        //public DateTime? LastExecution { get; set; }
    }

    public class HanfireHashKeySet
    {
        public string Key { get; set; }
        public string Json { get; set; }
    }







    /// <summary>
    /// hangfire任务状态
    /// </summary>
    public enum JobStatus
    {
        /// <summary>
        /// 未执行
        /// </summary>
        No = 0,
        /// <summary>
        /// 正在执行
        /// </summary>
        Executing = 1,
    }
}
